The "MICROSOFT" Object Linking and Embedding (OLE) 2.0 protocol that was established by Microsoft Corporation of Redmond, Wash. adopts an object model. In accordance with this object model, an "object" is a logical structure that may encapsulate both code and data. In some instances, an object encapsulates only code and not data. An object that contains other objects (i.e., an object in which other objects are stored) is known as a "container."
The "MICROSOFT" OLE 2.0 protocol defines a number of "interfaces."An "interface" is a named set of logically related functions. An interface lists signatures, such as parameters, for a set of functions but does not provide code for implementing the functions. The code for implementing the functions of the interface is provided by an object as an instance of an interface. When an object provides code for implementing the functions of an interface, the object is said to "support" the interface. The code provided by the object that supports the interface must comply with the signatures set forth within the interface definition. In the C++ programming language, an interface constitutes a set of virtual functions.
The "MICROSOFT" OLE 2.0 protocol supports the notion of a "compound document." A "compound document" is a container object that contains a "linked object" and/or an "embedded object." An "embedded object" is a source object that is physically stored in the compound document. A "linked object" has a corresponding source object that is not physically stored in the compound document but rather resides somewhere else. The linked object may be viewed as a stand-in in the compound document that enables the source to be visibly present in the compound document while the source object is not stored within the compound document. The linked object provides a link to the source object. Thus, the primary distinction between a linked object and an embedded object is where the source object is stored. A compound document may be viewed as a collection site for data from a variety of other sources that seamlessly integrates data of different formats. An example of a compound document is a word processing document that contains an embedded spreadsheet that has been created by a spreadsheet program.
A "container application" is an application program that maintains a container, such as a compound document. The container application provides storage for the compound document and a place for displaying objects for a compound document. In the example given above, a word processing program is the container application for the compound document that includes the embedded spreadsheet. The compound document that is managed by a container application may be logically divided into a number of levels. FIG. 1 depicts a diagram of the different logical levels that are provided in the container application 10. The container application 10 holds a compound document 12, such as a word processing document, that includes one or more pages 14. At least one of the pages 14 includes a site 16 at which an object such as a spreadsheet is embedded.
As mentioned above, an embedded object may be visibly present when a compound document is displayed. The embedded object may be displayed in iconic form such that an icon for the embedded object appears on the page of the compound document. In order to edit the embedded object in such a case, the embedded object must be opened by performing an action such as double clicking on the icon, to display a separate window for the embedded object. "MICROSOFT" OLE 2.0 facilitates inplace editing. In such an instance, an "object view" of an embedded object is displayed within the compound document because the embedded object is being displayed in a foreign frame. The object view does not have control over the printed page. Further, when the embedded object is a document having multiple pages, only a single page of the embedded document may be displayed by the object view at the site on the page of the compound document.
A frame is a boundary that bounds or frames a view port. It may include menus, toolbars, status bars and the like (much as a picture frame frames a picture). A native frame is a frame produced by the application that created or is associated with the object whose view is being displayed inside the frame. An example of a native frame is a word processing program frame in which a view of a word processing document is displayed. With a foreign frame, the frame is produced by an application program that is not associated with the object whose view is being displayed herein. An example of a foreign frame is a word processing document frame in which an embedded spreadsheet object is displayed.
"MICROSOFT" OLE 2.0 defines an interface, IViewObject, that enables a caller to ask an object to provide a pictorial representation of itself by drawing on a caller-provided context. This interface is used to display embedded objects in compound documents. In formal terms, the IViewObject interface is defined as follows:
__________________________________________________________________________ Interface IViewObject:IUnknown { virtual HRESULT Draw(dwAspect, lindex, pvAspect, ptd, hicTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue, dwContinue) = 0; virtual HRESULT GetColorSet(dwAspect, lindex, pvAspect, ptd, hicTargetDev, ppColorSet) = 0; virtual HRESULT Freeze(dwAspect, lindex, pvAspect, pdwFreeze) = 0; virtual HRESULT Unfreeze(dwFreeze) = 0; virtual HRESULT SetAdvise(grfAspects, grfAdvf, pAdvSink) = 0; virtual HRESULT GetAdvise(pgrfAspects, pgrfAdvf, ppAdvSink) = 0; }; __________________________________________________________________________
As can be seen from this interface definition, the interface includes a number of functions: Draw.oval-hollow., GetColorSet.oval-hollow., Freeze.oval-hollow., UnFreeze.oval-hollow., SetAdvise.oval-hollow. and GetAdvice.oval-hollow.. The Draw.oval-hollow. function is of particular interest to the present discussion. The Draw.oval-hollow. function may be utilized by a container object, like a compound document, to request that an embedded object provide a presentation of itself to be drawn on an output device. The pictorial representation of the embedded object is displayed at a predetermined site 16 on a page 14. The pictorial representation is the "object view". In general, the embedded document is displayed in the container's context. The container controls the appearance of the page 14. The container controls the layout of headers, footers, end notes and the like. The embedded object has no control over these aspects of the page 14. The container also controls the amount of space that is allocated to the embedded object for displaying its pictorial representation. Specifically, the container object may call the SetExtent.oval-hollow. function of the IOleObject interface that is defined by "MICROSOFT" OLE 2.0. These limitations of the view of the embedded object that is presented can be frustrating to the user and generally constitute unwanted constraints.